#pragma once
#include <iostream>
#include <qdialog.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>

class CustomBaudDialog;

class CustomBaudSingleton
{
public:
	static CustomBaudSingleton& getInstance();

	std::shared_ptr<CustomBaudDialog> getDialog();

	CustomBaudSingleton(const CustomBaudSingleton&) = delete;
	CustomBaudSingleton& operator=(const CustomBaudSingleton&) = delete;
	CustomBaudSingleton(const CustomBaudSingleton&&) = delete;
	CustomBaudSingleton& operator=(const CustomBaudSingleton&&) = delete;
	
private:
	CustomBaudSingleton();
	std::shared_ptr<CustomBaudDialog> dialog_;

};

class CustomBaudDialog :public QDialog
{
	Q_OBJECT
public:
	CustomBaudDialog();
	
signals:
	void accepted(int value);
	void rejected();
private:
	void init_UI();
	QLabel* label;
	QLineEdit* baud_edit;
	QPushButton* okButton;
	QPushButton* cancelButton;
};